import urllib.parse

url = "https://www.baidu.com/s?"
data = {
    "wd":"张三",
    "location":"辽宁沈阳"
}

res = urllib.parse.urlencode(data)
print(res)
# wd=%E5%BC%A0%E4%B8%89&location=%E8%BE%BD%E5%AE%81%E6%B2%88%E9%98%B3
res = url + res
print(res)




